package com.restkeeper.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang.StringUtils;

@Getter
@AllArgsConstructor
public enum VoiceTemplateIdEum {

    /**
     * 告警消息
     * */
    alarm("alarm", "TTS_307455043"),

    ;

    public String name;
    public String ttsCode;

    public static String getCodeByName(String name) {
        if(StringUtils.isBlank(name))
            return null;
        for (VoiceTemplateIdEum incomeTypeEnum : VoiceTemplateIdEum.values()) {
            if (incomeTypeEnum.name.equals(name)) {
                return incomeTypeEnum.getTtsCode();
            }
        }
        return null;
    }


}
